/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package org.cip.esymons.eventos.be;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;

/**
 *
 * @author oscar
 */
@Entity
@Table(name = "eca_instructor_modulo")
@NamedQueries({@NamedQuery(name = "InstructorModulo.findAll", query = "SELECT i FROM InstructorModulo i"), @NamedQuery(name = "InstructorModulo.findByInmCodigo", query = "SELECT i FROM InstructorModulo i WHERE i.inmCodigo = :inmCodigo")})
public class InstructorModulo implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "inm_codigo")
    private Integer inmCodigo;
    @JoinColumn(name = "ine_codigo", referencedColumnName = "ine_codigo")
    @ManyToOne(optional = false, fetch = FetchType.LAZY)
    private InstructorEvento ineCodigo;
    @JoinColumn(name = "mod_codigo", referencedColumnName = "mod_codigo")
    @ManyToOne(optional = false, fetch = FetchType.LAZY)
    private ModuloCurso modCodigo;
    @Column(name = "inm_estado")
    private boolean inmEstado;

    public InstructorModulo() {
    }

    public InstructorModulo(Integer inmCodigo) {
        this.inmCodigo = inmCodigo;
    }

    public Integer getInmCodigo() {
        return inmCodigo;
    }

    public void setInmCodigo(Integer inmCodigo) {
        this.inmCodigo = inmCodigo;
    }

    public InstructorEvento getIneCodigo() {
        return ineCodigo;
    }

    public void setIneCodigo(InstructorEvento ineCodigo) {
        this.ineCodigo = ineCodigo;
    }

    public ModuloCurso getModCodigo() {
        return modCodigo;
    }

    public void setModCodigo(ModuloCurso modCodigo) {
        this.modCodigo = modCodigo;
    }

    public boolean isInmEstado() {
        return inmEstado;
    }

    public void setInmEstado(boolean inmEstado) {
        this.inmEstado = inmEstado;
    }
    
    @Override
    public int hashCode() {
        int hash = 0;
        hash += (inmCodigo != null ? inmCodigo.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof InstructorModulo)) {
            return false;
        }
        InstructorModulo other = (InstructorModulo) object;
        if ((this.inmCodigo == null && other.inmCodigo != null) || (this.inmCodigo != null && !this.inmCodigo.equals(other.inmCodigo))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "org.cip.esymons.eventos.be.InstructorModulo[inmCodigo=" + inmCodigo + "]";
    }

}
